function columns(vm) {
  const cols = [
    {
      title: '序号',
      dataIndex: 'rowIndex',
      width: 80,
      align: 'center',
      customRender: function (t, r, index) {
        return parseInt(index) + 1
      }
    },
    {
      dataIndex: 'type',
      colSpan: 2,
      slots: { title: 'customTitle' },
      customRender: (value, row, index) => {
        const obj = {
          children: value,
          attrs: {},
        };
        if (value == '总计') {
          obj.attrs.colSpan = 2
        }
        obj.attrs.rowSpan = row.typerowSpan;
        return obj;
      }
    },
    {
      title: 'name',
      colSpan: 0,
      dataIndex: 'name',
      customRender: (value, row, index) => {
        const obj = {
          children: value,
          attrs: {},
        };
        if (value == '总计') {
          obj.attrs.colSpan = 0
        }
        return obj;
      }
    },
  ]
  return cols
}

export default columns